public Class TestClass
{
    static testMethod  void test()
    {
        Profile p = [select id from profile where Name='System Administrator' or name = '系统管理员' limit 1];
        User u2 = new User(alias = 'standtss', email='sdardr@testorgss.com',
        emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US',Title__c='TSR',
        localesidkey='en_US', profileid = p.Id,UserCity__c='广州',IsActive=true,
        UserAreaValue__c='广州区域',UserSubRegion__c='华南一区',UserRegion__c='华南区',
        timezonesidkey='America/Los_Angeles', username='stsers@testorg.com');
        insert u2;  
   
        User us = new User(alias ='standtss', email='standuser@testorgss.com',ManagerId=u2.Id,
        emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US',Title__c='ASM',
        localesidkey='en_US', profileid = p.Id,UserCity__c='广州',IsActive=true,
        UserAreaValue__c='广州区域',UserSubRegion__c='华南一区',UserRegion__c='华南区',
        timezonesidkey='America/Los_Angeles', username='standgsers@testorg.com');
        insert us;
        
        User u3 = new User(alias = 'standtss', email='stantguser@testorgss.com',ManagerId=u2.Id,
        emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US',Title__c='TSR',
        localesidkey='en_US', profileid = p.Id,UserCity__c='广州',IsActive=true,
        UserAreaValue__c='广州区域',UserSubRegion__c='华南一区',UserRegion__c='华南区',
        timezonesidkey='America/Los_Angeles', username='stantgsers@testorg.com');
        insert u3;
        
        User u = new User(alias = 'standtss', email='standarduser@testorgss.com',
        emailencodingkey='UTF-8', lastname='Testing', languagelocalekey='en_US',Title__c='ASM',
        localesidkey='en_US', profileid = p.Id,UserCity__c='广州',IsActive=true,
        UserAreaValue__c='广州区域',UserSubRegion__c='华南一区',UserRegion__c='华南区',
        timezonesidkey='America/Los_Angeles', username='standardusers@testorg.com');
        insert u;
        System.runAs(u)
        {
            Account acc=new Account();
             acc.Name='test';
             acc.Channel__c='特大型综合超市';
             acc.Outlet_Type__c='全国重点客户';
             acc.Contact__c='aaa';
             acc.No_of_checkout__c=22;
             acc.ContactPhoneNumber__c='1234567456';
             //acc.City__c=citys.Id;
             acc.OwnerId=u2.Id;
             insert acc;
            
            Account a=acc;
            a.OwnerId=u.Id;
            update a;
        }
        
        System.runAs(u)
        {
            List<Account> al=[select Name,OwnerId from Account where Name='test' limit 1];
            Account a=al[0];
            a.OwnerId=u3.Id;
            update a;
        }
    }
}